<template>
  <div class="login">
    <div class="login-container">
      <h3 class="title">光谷智慧交通</h3>
      <el-form :model="ruleForm">
        <el-form-item prop="username">
          <el-input
            v-model="ruleForm.username"
            placeholder="请输入您的用户名"
          />
        </el-form-item>
        <el-form-item prop="userpassword">
          <el-input v-model="ruleForm.password" placeholder="请输入您的密码" show-password/>
        </el-form-item>
        <el-form-item class="LogAndReg">
          <el-button type="primary" @click="login">登录</el-button>
        </el-form-item>
      </el-form>
    </div>
  </div>
</template>
<script setup>
import { useLogin } from "./hooks/useLogin"
const { ruleForm, login } = useLogin()
</script>

<style scoped>
.el-form-item {
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.1);
  border-radius: 5px;
  color: #220f0f;
}
.LogAndReg {
  margin-top: 30px;
  border: none;
  background: none;
}
</style>

<style scoped>
.login {
  background-color: #2d3a4b;
}
/* 加上scoped: 将样式限定到当前组件 */
.login {
  display: flex;
  justify-content: center;
  align-items: center;
  height: 100vh;
}
.login {
  position: fixed;
  top: 0;
  bottom: 0;
  left: 0;
  right: 0;
  background-color: #2d3a4b;
}
.login-container {
  width: 400px;
  margin: 150px auto;
  padding: 35px 35px 15px 35px;
  border-radius: 10px;
  box-shadow: 0 0 10px rgba(155, 155, 155, 0.8);
}
.login-container .title {
  margin: 0px auto 40px auto;
  font-size: 26px;
  font-weight: 700;
  color: #fff;
  text-align: center;
}
.el-button{
  width: 100%;
}
</style>
